package com.woniuxy.creditsystem.util;

import java.util.Calendar;
import java.util.Date;
//工具类，传入一个日期对象和递增值，返回该月的日期对象
//by 汪汪
public class MonthUtil {

    public static Date subMonth(Date date,int count){
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//        Date dt = sdf.parse(date);
//        System.out.println(dt);
        Calendar rightNow = Calendar.getInstance();
        rightNow.setTime(date);
        rightNow.add(Calendar.MONTH, count);
        Date dt1 = rightNow.getTime();
//        String reStr = sdf.format(dt1);
        return dt1;

    }

}
